home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / TOUCHWIN.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  60 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef touchwin
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_touchwin = "$Header: c:/curses/portable/RCS/touchwin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   touchwin()   - touch window
  15.  
  16.   X/Open Description:
  17.        Throw away all optimisation information about which parts of the
  18.        window have been touched, by pretending that the entire window has
  19.        been drawn on.  This is sometimes necessary when using overlapping
  20.        windows, since a change to one window will affect the other window,
  21.        but the records of which lines have been changed in the other
  22.        window will not reflect the change.
  23.  
  24.   PDCurses Description:
  25.        No additional functionality in the PDCurses library.
  26.  
  27.   X/Open Return Value:
  28.        The touchwin() function returns OK on success and ERR on error.
  29.  
  30.   PDCurses Errors:
  31.        It is an error to pass a NULL window.
  32.  
  33.   Portability:
  34.        PDCurses        int touchwin( WINDOW* win );
  35.        SysV Curses     int touchwin( WINDOW* win );
  36.        BSD Curses      int touchwin( WINDOW* win );
  37.        X/Open Dec '88  int touchwin( WINDOW* win );
  38.  
  39. **man-end**********************************************************************/
  40.  
  41. int    touchwin(WINDOW *win)
  42. {
  43.        int     y;
  44.        int     maxy;
  45.        int     maxx;
  46.  
  47.        if (win == (WINDOW *)NULL)
  48.                return( ERR );
  49.  
  50.        maxy = win->_maxy - 1;
  51.        maxx = win->_maxx - 1;
  52.  
  53.        for (y = 0; y <= maxy; y++)
  54.        {
  55.                win->_firstch[y] = 0;
  56.                win->_lastch[y] = maxx;
  57.        }
  58.        return( OK );
  59. }
  60.